<!--受理订单完成-->
<template>
  <div class="contain">
    <!--search-->
    <div class="m-sech-wrap mr20">
      <router-link to='/search?type=custom' @click.native="setStorage()" class="m-sech-box displayflex">
        <i class="iconfont icon-search"></i>
        <div class="flex1 m-sech-ipt">
          <div class="txt">{{sechTxt || '输入客户名称或单号'}}</div>
        </div>
      </router-link>
    </div>
    <div class="acpt-list">
      <div class="acpt-list-wrap mb30" v-for="item in todolist">
        <div class="acpt-list-head cf">
          <span class="time f-l">{{item.BillDate | timeshort}}</span>
          <em class="org f-r ft12">已完成</em>
        </div>
        <div class="displayflex acpt-list-body" @click="gotoDet(item)">
          <i class="iconfont icon-cargo"></i>
          <div class="txt flex1">
            <p class="ft17">{{item.MedName}}</p>
            <p>{{item.Province | province}} {{item.City | city}} {{item.District | district}} {{item.Address}}</p>
            <p>品种数：{{item.CountSum}}个</p>
          </div>
        </div>
      </div>
    </div>
    <manage-footer></manage-footer>
  </div>
</template>

<script>
import manageFooter from '@/components/core/footer/manage.footer.vue';
export default {
  name:'doneBill',
  components: {
    manageFooter
  },
  data() {
    return {
      sechTxt:'',
      billState:'P07',
      todolist:[],
    }
  },
  created(){
    this.sechTxt = sessionStorage.sechtxt;
  },
  watch: {
    
  },
  mounted() {
    this.$nextTick(function() {
        this.getdata();
    })
  },
  methods: {
    goLink(){
      sessionStorage.removeItem('sechtxt');
      this.sechTxt = '';
    },
    setStorage() {
      sessionStorage.billState = this.billState;
    },
    gotoDet(value){
      sessionStorage.item = JSON.stringify(value);
      this.$router.push({
        path:'/order/doneDetail'
      })
    },
    //获取数据
    getdata(){
      var self = this;
      var userinfo = JSON.parse(localStorage.userinfo);
      var query = {
        MedName:this.sechTxt,
        CorpGuid: userinfo.CorpGuid,
        BillState: 'P07',
        Page: 0,
        Rows: 100,
      };
      this.Ajax.post('SearchOrderCode',query).then(function(resp){
        self.todolist = resp.Datas;
      });
    },
  }
}
</script>